# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=delfin
pkgver=0.4.7
pkgrel=0
pkgdesc="Stream movies and TV shows from Jellyfin"
url="https://delfin.avery.cafe/"
arch="all !x86" # x86: fails to build
license="GPL-3.0-only"
depends="
	gtk4.0
	libadwaita
	mpv
	"
makedepends="
	cargo
	cargo-auditable
	clang
	desktop-file-utils
	gtk4.0-dev
	libadwaita-dev
	meson
	mpv-dev
	"
source="delfin-$pkgver.tar.gz::https://codeberg.org/avery42/delfin/archive/v$pkgver.tar.gz
	cargo-auditable.patch
	update-rust-libc.patch
	"
builddir="$srcdir/$pkgname"
options="net"

prepare() {
	default_prepare
	cargo fetch --locked
}

build() {
	abuild-meson . output -Dprofile=release
	meson compile -C output
}

check() {
	meson test --no-rebuild -C output
}

package() {
	cd "$builddir/output"
	meson install --no-rebuild --destdir "$pkgdir"
}

sha512sums="
98bcd4feab567a465f784549b259e221f834cbe267095162791c6cbcf9d08f447f3b410c97ba9977c2e5e433b4322fa7ef5196f3d748fd5d3673f08e2dae6b3c  delfin-0.4.7.tar.gz
a7f6e25c4acb6930f75503cc645d5fed2d9c193f60d690cb198a714c06e5d18c064b9f8a7e573268d3814f3d38305794aeb49582eb09280c5f7d5c17850dc8ce  cargo-auditable.patch
e41a82f7256b01074e8e07c633e9c7087981fe353e998ab8fff6e1755f315e20b95ca9b6aea5bfa63d26d6f1114b0beb081b910a973afa673e70c8d7c6c82107  update-rust-libc.patch
"
